﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class WorkTime_WorkTimeOvertimeList : System.Web.UI.Page
{
    private Srvtools.WebDataSet WMaster;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            InitializeComponent();

            Master.DataSource = WMaster;


            MasterPage_MasterPage mpg = (MasterPage_MasterPage)this.Page.Master;
            mpg.HelpHref = "~/Help/WorkTime/员工加班列表.htm";
            mpg.PageName = "员工加班列表";
            mpg.PicUrl = "";
            mpg.IntiBar();
        }
        this.WebClientQuery1.Show(this.Panel1);
    }

    private void InitializeComponent()
    {
        System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WorkTime_WorkTimeOvertimeList));
        this.WMaster = new Srvtools.WebDataSet();
        ((System.ComponentModel.ISupportInitialize)(this.WMaster)).BeginInit();
        // 
        // WMaster
        // 
        this.WMaster.Active = true;
        this.WMaster.AlwaysClose = false;
        this.WMaster.DeleteIncomplete = true;
        this.WMaster.Guid = null;
        this.WMaster.LastKeyValues = null;
        this.WMaster.PacketRecords = 100;
        this.WMaster.Position = -1;
        this.WMaster.RemoteName = "SWorkTime.View_WorkTime_Overtime";
        this.WMaster.ServerModify = false;
        ((System.ComponentModel.ISupportInitialize)(this.WMaster)).EndInit();

    }

    public string GetOverTimeRange(object StartHour, object StartMinute, object EndHour, object EndMinute)
    {
        if ((Convert.IsDBNull(StartHour) != true) && (Convert.IsDBNull(StartMinute) != true) && (Convert.IsDBNull(EndHour) != true) && (Convert.IsDBNull(EndMinute) != true))
        {
            return (string)StartHour + ":" + (string)StartMinute + "~" + (string)EndHour + ":" + (string)EndMinute;
        }
        else
        {
            return "";
        }
    }
    public override void DataBind()
    {
        wgvMaster.DataBind();
    }

    protected void WebNavigator1_Command(object sender, CommandEventArgs e)
    {
        if (e.CommandName == "cmdClientQuery")
        {
            WebClientQuery1.Execute();
        }
    }

    protected void btnSearch_Click(object sender, EventArgs e)
    {
        WebClientQuery1.Execute(Panel1);
        DataBind();
    }

    protected void btnClear_Click(object sender, EventArgs e)
    {
        WebClientQuery1.Clear(Panel1);
        Master.DataBind();
        wgvMaster.DataBind();
    }

}
